package com.jiyun.controller;


import com.jiyun.common.result.Result;
import com.jiyun.entity.pojo.Homepage;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.jiyun.service.HomepageService;

import java.util.List;


/**
 * (Homepage)表控制层
 *
 * @author LYT
 * @since 2025-01-16 18:36:13
 */
@RestController
@RequestMapping("homepage")
public class HomepageController {

    @Autowired
    private HomepageService homepageService;

    @PostMapping("/findList")
    public List<Homepage> findList() {
        return homepageService.list();
    }

    @GetMapping("findPrice")
    public List<Homepage> findPrice() {
       return homepageService.findPrice();
    }

    @GetMapping("findChoose")
    public List<Homepage> findChoose() {
        return homepageService.findChoose();
    }

    @GetMapping("findById/{id}")
    public Result findById(@PathVariable Integer id) {
        Homepage byId = homepageService.getById(id);
        return Result.ok(byId);
    }

    @PostMapping("selectOrder")
    public List<Homepage> selectOrder(@RequestParam Integer[] id) {
         return homepageService.selectOrder(id);
    }

    @PostMapping("findPage")
    public List<Homepage> findPage(@RequestParam Integer id) {
        return homepageService.findPage(id);
    }


}

